

/**
 * 生成一个序列
 * @param  {[type]} start [description]
 * @param  {[type]} end   [description]
 * @return {[type]}       [description]
 */
function createSequence(start, end) {
	if(arguments.length === 1) {
		end = arguments[0]
		start = 1
	}
	start = start | 0
    end = end | 0

    var tmp, result = []
	for (var i = start; i <= end; i++) {
		tmp = ''
		if(i % 3 === 0) {
			tmp += 'Fizz'
		}
		
		if(i % 5 === 0) {
			tmp += 'Buzz'
		}

		if(i % 3 && i % 5) {
			tmp += i
		}

		result.push(tmp)
	}

	return result
}

function createSequenceV2(start, end) {
	if(arguments.length === 1) {
		end = arguments[0]
		start = 1
	}
	start = start | 0
    end = end | 0

    var tmp, result = []
    for (var i = start; i <= end; ) {
    	var one = (i++ % 3 ? '' : 'Fizz') + (i % 5 ? '' : 'Buzz') || i
    	result.push(one)
    }
    return result
}

console.log(createSequence(20+1))
console.log(createSequenceV2(20+1))
